package com.gardenguell.salad.ui.fragment;

import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gardenguell.salad.R;
import com.gardenguell.salad.ui.activity.MainActivity;

/**
 * Created by absurd on 2015/11/21.
 */
public class KnowledgeFragment extends BaseFragment {

    private Toolbar mToolbar;
    private CollapsingToolbarLayout mCollapsingToolbarLayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_knowledge, container, false);

        ((MainActivity)getBaseActivity()).hideToolbar();

        mToolbar = (Toolbar)root.findViewById(R.id.fragment_toolbar);
        mCollapsingToolbarLayout = (CollapsingToolbarLayout)root.findViewById(R.id.fragment_collapsing_toolbar);

        mCollapsingToolbarLayout.setTitle(getString(R.string.app_name));

        getBaseActivity().setSupportActionBar(mToolbar);
        getBaseActivity().getSupportActionBar().setDisplayHomeAsUpEnabled(false);

        return root;
    }
}
